<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common.jsp"%>
<!-- 分页表单：搜索表单必须添加属性： rel="pagerForm"  -->
<%@include file="/pageParameter.jsp" %>
<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" 
		action="${ctxPath }/sys/sysUser/list" method="post">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
				    <td>真实姓名：
                        <input type="text" name="realName" value="${entity.realName}" />
                    </td>
                    <td>
						<div class="buttonActive">
							<div class="buttonContent">
							     <button title="查询" type="submit">查&nbsp;询</button>
							</div>
						</div>
					</td>
                 </tr>
			</table>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
				<li>
					<shiro:hasPermission name="sys/sysUser/add">
						<a title="添加用户" class="add"
							href="${ctxPath }/sys/sysUser/addUI" target="navTab"><span>添加用户</span>
						</a>
					</shiro:hasPermission>
				</li>
				<li class="line">line</li>
		</ul>
	</div>
	<table class="table" width="101%" layoutH="109">
		<thead>
			<tr>
				<th width="5%">序号</th>
				<th width="10%" orderField="loginName" class="${pageParam.orderField eq 'loginName' ? pageParam.orderDirection : ''}" >登录名称</th>
				<th width="10%" orderField="realName" class="${pageParam.orderField eq 'realName' ? pageParam.orderDirection : ''}" >真实名称</th>
				<th width="5%" orderField="birthday" class="${pageParam.orderField eq 'birthday' ? pageParam.orderDirection : ''}" >出生日期</th>
				<th width="10%" orderField="phone" class="${pageParam.orderField eq 'phone' ? pageParam.orderDirection : ''}" >手机号</th>
				<th width="5%" orderField="sex" class="${pageParam.orderField eq 'sex' ? pageParam.orderDirection : ''}" >性别</th><!-- 性别：0-未知，1-男，2-女 -->
				<th width="5%" orderField="status" class="${pageParam.orderField eq 'status' ? pageParam.orderDirection : ''}" >状态</th><!-- 0-启用，1-禁用 -->
				<th width="10%" orderField="createTime" class="${pageParam.orderField eq 'createTime' ? pageParam.orderDirection : ''}" >创建时间</th>
				<th >操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="item" items="${pageBean.recordList}" varStatus="s">
				<tr>
					<td>${s.index + 1}</td>
					<td>${item.loginName}</td>
					<td>${item.realName}</td>
					<td><fmt:formatDate value="${item.birthday}" pattern="yyyy-MM-dd" /></td>
					<td>${item.phone}</td>
					<td>
						<c:if test="${item.sex==0}">未知</c:if>
						<c:if test="${item.sex==1}">男</c:if>
						<c:if test="${item.sex==2}">女</c:if>
					</td>
					<td>
						<c:if test="${item.status==0}">启用</c:if>
						<c:if test="${item.status==1}">禁用</c:if>
					</td>
					<td><fmt:formatDate value="${item.createTime}"
					     pattern="yyyy-MM-dd HH:mm:ss" />
			        </td>
			        <td>
						<shiro:hasPermission name="sys/sysUser/edit"> 
							<a href="${ctxPath}/sys/sysUser/editUI?id=${item.id}" title="修改用户" class="btnEdit" 
								target="dialog" mask="true" width="550" height="600" >修改</a>
						</shiro:hasPermission>
						<shiro:hasPermission name="sys/sysUser/delete">	
							<a href="${ctxPath}/sys/sysUser/delete?id=${item.id}" 
								title="删除用户" class="btnDel" target="ajaxTodo" >删除</a>
						</shiro:hasPermission>	
						<shiro:hasPermission name="sys/sysUser/assignRole">
							<a href="${ctxPath}/sys/sysUser/assignRoleUI?id=${item.id}" title="为用户【${item.realName}】分配角色"  
								class="btnAssign" mask="true" target="dialog" width="550" height="600" >分配角色</a>
						</shiro:hasPermission>
			        </td>
				</tr>
			</c:forEach>
			<c:if test="${pageBean.totalCount==0}"><tr><td>暂无数据</td></tr></c:if>
		</tbody>
	</table>
	<%@include file="/pageBar.jsp" %>
</div>
